from rest_framework import permissions


class ConsPermissions(permissions.BasePermission):
    """
        管理员接口使用
    """

    def has_permission(self, request, view):
        if request.user and request.user.is_authenticated:
            return request.user.user_profile
        return False
